package com.shenma2009.domain;

import com.shenma2009.vo.IdVo;
import lombok.Data;

/**
 * @author 军哥
 * @version 1.0
 * @description: ResultResponse
 * @date 2023/4/19 15:56
 */

@Data
public class ResultResponse {
    private int code;
    private String msg;
    private Object data;

    public static ResultResponse SUCCESS() {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(200);
        resultResponse.setMsg("操作成功");

        return resultResponse;
    }

    public static ResultResponse SUCCESS(Object data) {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(200);
        resultResponse.setMsg("操作成功");
        resultResponse.setData(data);

        return resultResponse;
    }

    public static ResultResponse FAILED(int code, String msg) {
        ResultResponse resultResponse = new ResultResponse();
        resultResponse.setCode(code);
        resultResponse.setMsg(msg);

        return resultResponse;
    }
}
